From: Keir Fraser Date: Tue, 17 Aug 2010 18:32:37 +0000 (+0100) Subject: x86 cpuidle: check whether cpu is online in cpu idle control X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11616 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=2a9f4ae1adfa1029587590f9af1a373ae85155a4;p=xen.git x86 cpuidle: check whether cpu is online in cpu idle control We observed a 2.6.18.8 dom0 kernel crash when Xen has maxcpus < num of physical cores (maxcpus=3D4 for a 12-core system). It appeared that hypervisor doesn't check whether CPU is online or not. This small patch fixed the issue. Signed-off-by: Uwe Dannowski Acked-by: Wei Huang --- diff --git a/xen/arch/x86/acpi/cpuidle_menu.c b/xen/arch/x86/acpi/cpuidle_menu.c index c050972a9f..38a5543c00 100644 --- a/xen/arch/x86/acpi/cpuidle_menu.c +++ b/xen/arch/x86/acpi/cpuidle_menu.c @@ -270,9 +270,10 @@ static void menu_reflect(struct acpi_processor_power *power) static int menu_enable_device(struct acpi_processor_power *power) { - struct menu_device *data = &per_cpu(menu_devices, power->cpu); + if (!cpu_online(power->cpu)) + return -1; - memset(data, 0, sizeof(struct menu_device)); + memset(&per_cpu(menu_devices, power->cpu), 0, sizeof(struct menu_device)); return 0; }